import { createApp } from "vue";
import EwgConfirm from "@/components/common/EwgConfirm.vue";
export const confirm = (msg: string, type = 0) => {
  const element = document.createElement("div");
  element.className = `.confirm-container`;
  document.body.appendChild(element);
  return new Promise((res, rej) => {
    EwgConfirm.props.msg.default = msg;
    EwgConfirm.props.res.default = res;
    EwgConfirm.props.rej.default = rej;
    EwgConfirm.props.type.default = type;
    createApp(EwgConfirm).mount(element);
  });
};
